package com.example.s03_mybatis.controller;

import com.example.s03_mybatis.mapper.UserMapper;
import com.example.s03_mybatis.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//
@RestController
public class UserController {

    @Autowired
    private UserMapper userMapper;


    @RequestMapping("/register")
    public String register(User u)
    {
        userMapper.insert(u);
        return "操作成功";
    }
}
